const { merge } = require('webpack-merge')

const path = require('path')
const common = require('./webpack.common')
const { optimize } = require('webpack')

module.exports = merge(common, {
  mode: 'development',
  devtool: 'cheap-module-source-map',
  devServer: {
    open: true,
    static: './public',
    hot: true,
    // hotOnly: true,
  },
  optimization: {
    // sideEffects: true, // 开启副作用功能
    usedExports: true, // 只导出被使用的模块
    minimize: true, // 压缩输出结果
    concatenateModules: true // 尽可能合并导出模块到一个函数中
  }
})
